/* 移动端适配样式 */

/* 基础适配 */
html, body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* 状态栏适配 */
.status-bar {
  height: var(--status-bar-height, 0px);
  background: var(--primary-color);
}

/* 安全区域适配 */
.safe-area-inset-top {
  padding-top: constant(safe-area-inset-top);
  padding-top: env(safe-area-inset-top);
}

.safe-area-inset-bottom {
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-inset-left {
  padding-left: constant(safe-area-inset-left);
  padding-left: env(safe-area-inset-left);
}

.safe-area-inset-right {
  padding-right: constant(safe-area-inset-right);
  padding-right: env(safe-area-inset-right);
}

/* 移动端导航栏 */
.mobile-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  
  .navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: 44px;
    
    .back-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.2);
      color: #fff;
      
      &:active {
        background: rgba(255, 255, 255, 0.3);
      }
    }
    
    .title {
      font-size: 18px;
      font-weight: 600;
      color: #fff;
      flex: 1;
      text-align: center;
      margin: 0 16px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    .menu-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
    }
  }
}

/* 移动端主体内容 */
.mobile-main {
  padding-top: 60px; // 导航栏高度 + 状态栏
  min-height: 100vh;
  
  &.has-tabbar {
    padding-bottom: 60px; // 底部导航栏高度
  }
}

/* 移动端底部导航 */
.mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #fff;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  
  .tabbar-content {
    display: flex;
    height: 60px;
    
    .tab-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #999;
      font-size: 12px;
      text-decoration: none;
      
      &.active {
        color: var(--primary-color);
      }
      
      .tab-icon {
        font-size: 20px;
        margin-bottom: 2px;
      }
      
      .tab-text {
        font-size: 10px;
      }
    }
  }
}

/* 移动端卡片样式 */
.mobile-card {
  background: #fff;
  border-radius: 12px;
  margin: 8px 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 移动端列表 */
.mobile-list {
  background: #fff;
  
  .list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    
    &:last-child {
      border-bottom: none;
    }
    
    &:active {
      background: #f8f8f8;
    }
    
    .item-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      margin-right: 12px;
      overflow: hidden;
      
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
    
    .item-content {
      flex: 1;
      
      .item-title {
        font-size: 16px;
        color: #333;
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      
      .item-desc {
        font-size: 14px;
        color: #666;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    
    .item-action {
      margin-left: 12px;
      color: #999;
    }
  }
}

/* 移动端按钮 */
.mobile-btn {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border-radius: 22px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  margin: 16px 0;
  
  &.primary {
    background: var(--primary-color);
    color: #fff;
    
    &:active {
      background: var(--primary-dark);
    }
  }
  
  &.secondary {
    background: #f0f0f0;
    color: #333;
    
    &:active {
      background: #e0e0e0;
    }
  }
}

/* 移动端阅读器样式 */
.mobile-reader {
  background: #faf9f7;
  min-height: 100vh;
  
  .reader-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
    
    &.hidden {
      transform: translateY(-100%);
    }
  }
  
  .reader-content {
    padding: 80px 20px 80px;
    max-width: 100%;
    
    .chapter-title {
      font-size: 20px;
      font-weight: 600;
      color: #333;
      margin-bottom: 24px;
      text-align: center;
    }
    
    .chapter-text {
      font-size: 16px;
      line-height: 1.8;
      color: #333;
      text-align: justify;
      
      p {
        margin-bottom: 16px;
        text-indent: 2em;
      }
    }
  }
  
  .reader-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
    
    &.hidden {
      transform: translateY(100%);
    }
    
    .footer-content {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      
      .chapter-nav {
        display: flex;
        align-items: center;
        gap: 16px;
        
        .nav-btn {
          padding: 8px 16px;
          background: var(--primary-color);
          color: #fff;
          border-radius: 20px;
          font-size: 14px;
          text-decoration: none;
          
          &:disabled {
            background: #ccc;
            pointer-events: none;
          }
        }
      }
      
      .chapter-info {
        font-size: 12px;
        color: #666;
      }
    }
  }
}

/* 移动端表单 */
.mobile-form {
  padding: 20px;
  
  .form-item {
    margin-bottom: 20px;
    
    .form-label {
      display: block;
      font-size: 14px;
      color: #333;
      margin-bottom: 8px;
    }
    
    .form-input {
      width: 100%;
      height: 44px;
      padding: 0 16px;
      border: 1px solid #e0e0e0;
      border-radius: 8px;
      font-size: 16px;
      background: #fff;
      
      &:focus {
        border-color: var(--primary-color);
        outline: none;
      }
    }
    
    .form-textarea {
      width: 100%;
      min-height: 100px;
      padding: 12px 16px;
      border: 1px solid #e0e0e0;
      border-radius: 8px;
      font-size: 16px;
      background: #fff;
      resize: vertical;
      
      &:focus {
        border-color: var(--primary-color);
        outline: none;
      }
    }
  }
}

/* 响应式断点 */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .el-container {
    flex-direction: column;
  }
  
  .el-aside {
    width: 100% !important;
    height: auto !important;
  }
  
  .el-main {
    padding: 0;
  }
  
  .el-header {
    height: auto !important;
    padding: 0;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
  
  .mobile-navbar,
  .mobile-tabbar {
    display: none;
  }
  
  .mobile-main {
    padding-top: 0;
    padding-bottom: 0;
  }
} 